package com.suray.system.run.seer.type;

import com.suray.basic.wcs.utils.IBaseEnum;

import java.io.Serializable;

public enum SeerAgvProcess implements IBaseEnum<Serializable> {
    INIT(0, "初始化"),
    SEND_TASK(10, "开始任务"),
    WAIT_START_OK(11, "等待起点允许进入取货"),
    SEND_GET_CARGO(40, "发送进入起点取货"),
    SEND_OUT_START(45, "发送离开起点"),
    SEND_RUN_TO_OUT_END(50, "发送前往放货点外面"),
    WAIT_GET_CARGO(55, "等待取货完成"),
    WAIT_OUT_START(60, "等待离开取货点"),
    WAIT_END_OK(65, "等待放货点允许进入放货"),
    SEND_PUT_CARGO(70, "发送进入放货点放货"),
    SEND_OUT_END(75, "发送离开放货点"),
    SEND_TASK_CLOSE(80, "发送任务封口"),
    WAIT_PUT_CARGO(85, "等待放货完成"),
    WAIT_OUT_END(90, "等待离开放货点"),
    WAIT_TASK_END(95, "等待任务结束"),
    END(100, "任务结束"),
    ;

    int value;
    String des;
    SeerAgvProcess(int value, String des) {
        this.value = value;
        this.des = des;
    }

    public Integer getValue() {
        return value;
    }

    public static SeerAgvProcess parseProcess(int value) {
        for (SeerAgvProcess process : SeerAgvProcess.values()) {
            if (process.value == value) {
                return process;
            }
        }

        throw new RuntimeException("seer agv 任务进度错误");
    }

    @Override
    public String toString() {
        return des;
    }

    @Override
    public String getDescription() {
        return des;
    }

    @Override
    public Serializable getVal() {
        return null;
    }
}
